<?php
    ob_start("ob_gzhandler");
   
   	extract($_POST);
    extract($_GET);
    
    session_cache_expire(100);
	
    #Iniciando a sessão
	session_start();

	include("connect.php");
	include("lib/lib.php");
	
  	
    
	/*if($_SESSION['#jbfm#log'] == "#jb@2010#")
    {   */
	    
    
        require_once("lib/url-q.php");
	?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
<link href="css/form.css" rel="stylesheet" type="text/css" />

<script language="javascript" src="js/geral.js"> </script>

<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> 
<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<!-- jquery -->
<script language="javascript" src="js/jquery-min.js"> </script>
<script language="javascript" src="js/jquery.alerts/jquery.alerts.js"> </script>
<link href="js/jquery.alerts/jquery.alerts.css" rel="stylesheet" type="text/css" />

<!--
	Textarea
-->
<script type="text/javascript">
tinyMCE.init({
    // General options
    mode : "textareas",
    theme : "advanced",
    plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager",

    // Theme options
    theme_advanced_buttons1 : ",bold,italic,underline,strikethrough,|,undo,redo,|,link,unlink,removeformat,cleanup,code",
    theme_advanced_buttons2 : "",
    theme_advanced_buttons3 : "",
    theme_advanced_buttons4 : "",
    theme_advanced_toolbar_location : "top",
    theme_advanced_toolbar_align : "left",
    theme_advanced_statusbar_location : "bottom",
    theme_advanced_resizing : true,
    forced_root_block : false,
    force_p_newlines : false,
    paste_text_use_dialog : true,
    remove_linebreaks : false,
    force_br_newlines : true,

    // Example content CSS (should be your site CSS)
    //content_css : "css/example.css",

    // Drop lists for link/image/media/template dialogs
    template_external_list_url : "tinymce/examples/js/template_list.js",
    external_link_list_url : "tinymce/examples/js/link_list.js",
    external_image_list_url : "tinymce/examples/js/image_list.js",
    media_external_list_url : "tinymce/examples/js/media_list.js",

    // Replace values for the template plugin
    template_replace_values : {
        username : "Some User",
        staffid : "991234"
    }
});
</script>

           <!--
<script type="text/javascript">
tinyMCE.init({ 
            mode : "textareas", 
            theme : "advanced", 
            theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist,link,unlink,code,removeformat,cleanup", 
            theme_advanced_buttons2 : "", 
            theme_advanced_buttons3 : "",
            extended_valid_elements : "a[name|href|target|title|onclick]",
            paste_retain_style_properties : "none",
            paste_text_use_dialog : true,
            paste_auto_cleanup_on_paste : true,
            paste_remove_spans : true,
            paste_remove_styles : true,
            paste_insert_word_content_callback : "convertWord",
            forced_root_block : false,
            force_p_newlines : false,
            remove_linebreaks : false,
            force_br_newlines : true,
            convert_newlines_to_brs: true                                
            });

     </script>          -->

<link rel="stylesheet" type=text/css href="css/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type=text/css href="css/geral.css" />
<title>AD JBFM</title>
</head>
<body>
<?php 
    if($msg == 1):
?> 
<script>
$(document).ready(function(){
    $("#Msg").html("<ul><li>Altera&ccedil;&otilde;e(s) efetuada(s) com sucesso.</li></ul>");
    $("#retornoMsg").fadeIn('fast');
    $("#retornoMsg").fadeOut(8000);
});
</script>
<?php endif;
    if($msg == 2):
 ?>
<script>
$(document).ready(function(){
    $("#Msg").html("<ul><li>Erro na hora de efetuar sua(s) altera&ccedil;&atilde;o.</li></ul>");
     $("#retornoMsg").fadeIn('fast');
});
</script>
<?php endif;?>

<table width="98%" height="100%" cellpadding="0" cellspacing="0" border=0>
    <tr>
        <td colspan="2" class="topoBlog">
            <table width="800">
            	<tr>
            		<td><br /><img src="images/main/topo.jpg" /></td>
                    <td valign="top" align="right"><a href="logout.php">Sair</a></td>
                </tr>				
            </table>
        </td>
    </tr>
    <tr>
        <td colspan="2">
            <div class="barraUsuario ftPadrao">BEM VINDO : <?php echo $_SESSION["nomeUsuario"]; ?>, &Uacute;LTIMO ACESSO EM: <?php echo dataExtensoHora($_SESSION["dtacesso"]); ?></div>
        </td>
    </tr>
    <tr>
        <td valign="top" width="16%" >
            <!-- Inicio menu -->
            <div id="menuLista">
                <!-- Items do Menu -->
                         <?php include "menu.php"; ?>

            </div>
            <br />
        </td>
        <td valign="top" align="left">
             
             <div id="main" class="main" >
             <?php if($msg): ?>
                <div id="retornoMsg">
                    <div id="Msg" style="margin-left:20px;"></div>
                </div>
             <? endif; ?>
                <? include ("main_page.php"); ?>
             </div>
         </td>
    </tr>

</table>
</body>
</html>

<?			
	
	/*
	}else
    {
		header("location:index_painel.php");
	} */
	ob_end_flush();
?>
